import type { App } from 'vue'
import debounce from './modules/debounce'

// const directivesList: any = { debounce } 方并且都有项目优化，代码优化等

const directives = {
  install: function (app: App<Element>) {
    // 这里真是学习了
    const debounceObject: Record<string, any> = debounce // 显式定义 debounceObject 的类型
    Object.keys(debounce).forEach((key) => {
      // 注册所有自定义指令
      app.directive(key, debounceObject[key])
    })
  }
}

export default directives
